

	<!-- 当前所在位置 START -->
	{include file="_url.here.tpl"}
	<!-- 当前所在位置 END -->

	<!-- 主体区 -->
	<div class="area">

		<!-- 主体左边区 START -->
		<div class="aleft">
			
			<!-- 左边导航栏 START -->
			
{include file='./user/_user.nav.tpl'}
			<!-- 左边导航栏 END -->
			
		</div>
		<!-- 主体左边区 END -->

		<!-- 主体右边区 START -->
		<div class="aright">

			<!-- 订单详情 START -->
			<div class="dl_t_block bdcolor-red">
				<div class="tt">
					<div class="line">
						<div class="left color-red">
							订单详情
						</div>
						
					</div>
					<div class="clear"></div>
					<div class="line">
						<div class="left color-red">
							订单号：<b>{$orderinfo.sn}</b>
						</div>
						<em><a href="./index.php?frm=user&mdl=address&do=edit">打印</a></em>
					</div>

				</div>

				<!-- 订单状态 START -->
				<div class="main-block pattern_line ">
					<form id="fm_order" action="./index.php" method="post">
						<input type="hidden" name="frm" value="user" />
						<input type="hidden" name="mdl" value="order" />
						<input type="hidden" name="do" value="index" />
						<input type="hidden" name="sn" value="{$orderinfo.sn}" />

						<dl><dt><h2>订单状态</h2></dt><div class="clear"></div></dl>
						<dl><dt>订单状态：</dt><dd>{$orderinfo.statename}，{$orderinfo.payment_statename}，{$orderinfo.delivery_statename}</dd><div class="clear"></div></dl>
						<dl><dt>下单时间：</dt><dd>{$orderinfo.addtime}</dd><div class="clear"></div></dl>
						<dl><dt>确认时间：</dt><dd>{if $orderinfo.state > 0}{$orderinfo.confirm_time}{else}{$orderinfo.statename}{/if}</dd><div class="clear"></div></dl>
						<dl><dt>付款时间：</dt><dd>{if $orderinfo.payment_state > 0}{$orderinfo.payment_time}{else}{$orderinfo.payment_statename}{/if}</dd><div class="clear"></div></dl>
						<dl><dt>收货时间：</dt><dd>{if $orderinfo.delivery_state > 0}{$orderinfo.delivery_time}{else}{$orderinfo.delivery_statename}{/if}</dd><div class="clear"></div></dl>
						<!-- 按钮区 START -->
						<div class="order_show_act_area">
							{if $orderinfo.payment_state < 2}
							<input type="button" id="btn_pay" value="支付" class="btn-2th" onclick="do_action('pay');" />
							{/if}
							{if $orderinfo.state > 0 && $orderinfo.payment_state < 2}
								{if $orderinfo.delivery_state < 2}
								<input type="button" id="btn_cancel" value="取消" class="btn-2th" onclick="do_action('cancel');" />
								{/if}
							{/if}
							{if $orderinfo.delivery_state == 2}
								<input type="button" id="btn_receive" value="收货" class="btn-2th" onclick="do_action('receive');" />
							{elseif $orderinfo.state >= 2 && $orderinfo.payment_state == 2 && $orderinfo.delivery_state > 2}
								{if $orderinfo.state == 2}
								<input type="button" id="btn_comment" value="评价" class="btn-2th" onclick="do_action('comment');" />
								{/if}
								<!-- <input type="button" id="btn..." value="晒单" class="btn-2th" onclick="do_action('...');" />
								<input type="button" id="btn..." value="还要买" class="btn-2th" onclick="do_action('...');" /> -->

							{/if}

						</div>
						<!-- 按钮区 END -->
					</form>
				</div>
				<!-- 订单状态 END -->
			</div>
			<!-- 订单详情 END -->


			<div class="space20"></div>

			<!-- 商品清单 START -->
			<div class="dl_t_block bdcolor-blue tb_list_border">

				<table class="tb_list goods-list">
					<!-- 表头 START -->
					<thead>
						<tr>
							<th colspan="8">商品清单</th>
						</tr>
						<tr>
							<th style="width:100px;">商品编号</th>
							<th style="width:64px;">图片</th>
							<th>商品名称</th>
							<th style="width:200px;">规格</th>
							<th style="width:60px;">重量</th>
							<th style="width:60px;">单价</th>
							<th style="width:50px;">数量</th>
							<th style="width:50px;">小计</th>
						</tr>
					</thead>
					<!-- 表头 END -->

					<!-- 列表 START -->
					<tbody>
						{foreach from=$goodslist item=goods}
						<tr>
							<td>{$goods.sn}</td>
							<td><a href="{$goods.url}" title="{$goods.goodsinfo.name}<br />
--------<br />
重量：{$goods.goodsinfo.fweight}{$goods.goodsinfo.weightunit}<br />
单价：￥{$goods.goodsinfo.price}" target="_blank" class="poshytip"><img src="{$_s.up_dir}thumb/92_70/{$goods.goodsinfo.cover}" /></a></td>
							<td><a href="{$goods.url}" target="_blank">{$goods.goodsinfo.name}</a></td>
							<td><dl class="spec">
								{foreach from=$goods.fspecs item=spec}
									<dt>{$spec.name}：</dt><dd>{$spec.value}</dd>
								{/foreach}
							</dl></td>
							<td>{$goods.fweight}{$goods.weightunit}</td>
							<td>￥{$goods.price}</td>
							<td>×&nbsp;{$goods.number}</td>
							<td>=&nbsp;￥{$goods.cost}</td>
						</tr>
						{/foreach}
						
					</tbody>
					<!-- 列表 END -->

				</table>

			</div>
			<!-- 商品清单 END -->


			<div class="space20"></div>

			<!-- 收货人信息 START -->
			<div class="sl_t_block bdcolor-olivine">
				<div class="tt">
					<h2 class="color-olivine">收货人信息</h2>
				</div>
				<!-- 收货人信息 START -->
				<div class="main-block pattern_line tower">
					<dl><dt><h2>收货人信息</h2></dt></dl>
					<div class="clear"></div>
					<dl><dt>收货人：</dt><dd>{$addrinfo.consignee}</dd></dl>
					<div class="clear"></div>
					<dl><dt>详细地址：</dt><dd>{$addrinfo.province_name}{$addrinfo.city_name}{$addrinfo.area_name}{$addrinfo.address}</dd></dl>
					<dl><dt>邮政编码：</dt><dd>{$addrinfo.zipcode}</dd></dl>
					<dl><dt>固定电话：</dt><dd>{$addrinfo.tel}</dd></dl>
					<dl><dt>手机号码：</dt><dd>{$addrinfo.mobile}</dd></dl>
					<dl><dt>电子邮箱：</dt><dd>{$addrinfo.email}</dd></dl>
					<dl><dt>送货时间：</dt><dd>送货时间：只工作日送货(双休日、假日不用送)</dd></dl>
					<div class="clear"></div>
				</div>
				<!-- 收货人信息 END -->
			</div>
			<!-- 收货人信息 END -->

			<div class="space20"></div>

			<!-- 配送方式 & 支付方式 & 金额总计 & 备注信息 START -->
			<div class="sl_t_block bdcolor-orange">
				<div class="tt">
					<h2 class="color-orange">配送方式 & 支付方式 & 金额总计 & 备注信息</h2>
				</div>

				<!-- 配送方式 & 支付方式 START -->
				<div class="main-block pattern_line tower">
					<dl><dt>配送方式：</dt><dd>{$deliveryinfo.name}</dd></dl>
					<dl><dt>运费：</dt><dd>￥{$orderinfo.delivery_fee}</dd></dl>
					<dl><dt>支付方式：</dt><dd>{$paymentinfo.name}</dd></dl>
					<dl><dt>手续费：</dt><dd>￥{$orderinfo.payment_fee}</dd></dl>
					<div class="clear"></div>
				</div>
				<!-- 配送方式 & 支付方式 END -->
		
				<!-- 金额总计 START -->
				<div class="main-block pattern_line_right key-item">
					<dl><dt>商品总重量：</dt><dd>{$orderinfo.weight}kg</dd><div class="clear"></div></dl>
					<dl><dt>商品总价：</dt><dd>￥{$orderinfo.goods_cost}</dd><dd>+</dd><dt>配送运费：</dt><dd>￥{$orderinfo.delivery_fee}</dd><dd>+</dd><dt>支付手续费：</dt><dd>￥{$orderinfo.payment_fee}</dd><div class="clear"></div></dl>
					<dl><dt>应付金额：</dt><dd><b>￥{$orderinfo.cost}</b></dd><div class="clear"></div></dl>
				</div>
				<!-- 金额总计 END -->

				<!-- 备注信息 START -->
				<div class="main-block padding10">{$orderinfo.memo}</div>
				<!-- 备注信息 END -->

			</div>
			<!-- 配送方式 & 支付方式 & 金额总计 & 备注信息 END -->


		</div>
		<!-- 主体右边区 END -->

	</div>

	<script type="text/javascript" language="JavaScript" charset="utf-8">
<!--
	var state			= parseInt('{$orderinfo.state}');
	var payment_state	= parseInt('{$orderinfo.payment_state}');
	var delivery_state	= parseInt('{$orderinfo.delivery_state}');

	{literal}
	function do_action(action){
		//debugger;
		var fm = $('#fm_order');
		var msg = '';
		switch(action){
			case 'cancel':
				msg = '确定要取消本订单？';
				if(payment_state == 2){
					return showmsg_info('当前订单已经付款成功，不可取消!');
				}else if(delivery_state == 2){
					return showmsg_info('当前订单已经发货，不可取消!');
				}
				return myconfirm(msg, {submit: confirm_action});
				fm.find('input[name="frm"]').val('user');
				fm.find('input[name="mdl"]').val('order');
				fm.find('input[name="do"]').val('cancel');
				break;

			case 'pay':
				if(state == -1 || state == -2){
					return showmsg_info('当前订单已经取消或无效，暂时无法付款!');
				}else if(payment_state == 1){
					msg = '记录显示您之前已经有进行支付，您确定要重新支付？';
				}else if(payment_state == 2){
					return showmsg_info('当前订单您已经成功付款过款了！');
				}
				fm.find('input[name="frm"]').val('pay');
				fm.find('input[name="mdl"]').val('index');
				fm.find('input[name="do"]').val('');
				if(msg != ''){
					return myconfirm(msg, {submit: confirm_action});
				}
				break;

			case 'receive':
				if(delivery_state < 2){
					return showmsg_info('当前订单还未发货，无法收货！！！');
				}
				fm.attr('target', 'ajax');
				fm.find('input[name="frm"]').val('user');
				fm.find('input[name="mdl"]').val('order');
				fm.find('input[name="do"]').val('receive');
				return myconfirm('请确认您已经收到货品？', {submit: confirm_action});
				break;

			case 'comment':
				if(state < 2){
					return showmsg_info('当前订单还未完成，不能评价。');
				}
				fm.attr('target', '_self');
				fm.find('input[name="frm"]').val('user');
				fm.find('input[name="mdl"]').val('order');
				fm.find('input[name="do"]').val('comment');
				break;
		}
		$('#fm_order').trigger('submit');
	}

	function confirm_action(e, v, m, f){
		if(v == true){
			$('#fm_order').trigger('submit');
		}
	}

	function receive_callback(params){
		if(params.result == 'succ'){
			params.msg = '确认收货成功';
			//$('#btn_receive').hide();
			params['onClosed'] = function(){
				return myconfirm('现在去评价？', {submit: function(){
					state = 2;
					payment_state = 2;
					delivery_state = 3;
					do_action('comment');
				}});
			}
		}else{
			if(params.msg == ''){
				params.msg = '确认收货失败';
			}
		}
		callback_common(params);

	}
	{/literal}
-->
</script>